package demo05Datepractice;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Demo01 {
    public static void main(String[] args) throws ParseException {
        Date d=new Date();
        System.out.println(d);
        long time = d.getTime();
        System.out.println("time = " + time);
       String pattern="yyyy-MM-dd hh:mm:ss";
        DateFormat d1= new SimpleDateFormat(pattern);
        String format = d1.format(d);
        System.out.println("format = " + format);
        Date parse = d1.parse(format);
        System.out.println("parse = " + parse);


    }
}
